package com.share.base.constant;

public enum StatusCode {
    INSERT_SUCCESS(210, "插入成功"),
    UPDATE_SUCCESS(220, "更新成功"),
    DELETE_SUCCESS(230, "删除成功"),
    NOT_FOUND(404, "未找到资源"),
    INTERNAL_ERROR(500, "内部服务器错误");

    private final int code;
    private final String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "StatusCode{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
